new task method and fixed error with return code