more changes to state machine. Fixed issue with Button not appearing