Removing invalid ref