fixed issue with switch statement not breaking