digital read/write not working within switch/case serial loop

Hi,
no there is only serial data when I press a button on the andorid app that is communicating with the serial port, I see the problem now as it can only read the button state when the serial data is being sent, due to it being within the serials IF statement.

Any idea how I can implement reading the pin state and changing the mode whilst also monitoring the serial input?