fix NPE when dispose