Fixed a null bug