fix NPE when submitting error.