updated complete_task to use message expectation