added breaks to state machine