fixed NPE that occurs in debug mode