Bug Fix on queryRelatedRecords