Handled null pointer exception which was happening during startup