trying to fix a strange ordering issue with relationship queries