Fixed Null pointer error