fixed null pointer reference