Possible NULL pointer dereferencing fixed