Fixing null bug