fixed NullReferenceException