improve next task method