Added task state change listener