added checking logic to tasks