I think you have to check your switch case statements .