Possible null pointer exception fixed