fix NullPointer exception