Fix bug with updating task stage