Null pointer fix