add task method for wait