Fixed possible NPE