Fixed NullReferenceException