fix Null pointer access