fix a NullReferenceException