fixed null bug