Updated for stopping the task and removed multiple calling