switch statements are breaking