fix for null bug