handled null pointer exception