state machine and asynchronous executing