auto select the right stage when task is edited