Added gen_fsm behavior