avoid NullPointerException which may occur during the small time window at stage end