Fixed Bug and NullPointer