fixed a null value issue