Using Switch in a If if condition

You could move that delay(50) up inside the if() statement.