Fix Null pointer error