Fixed what seemed to be an error in case statement