fixed a null issue