procedures for running coroutine