Another useful function for coroutines