The problem is that you did not add the break; before the second case statement.
Or does the error still occure?