Fix possible relation bug