Fixed NullPointer exception