fixed a null pointer