Fixed a possible NPE