catch NullPointerException in StageListener