sending state machine bug