handling maybe fields correctly with sub-selects