NPE Fixed

Fixed possible NPE