fixed NullPointerException handled when cancelling saving