remove debug and change INNER JOIN to LEFT JOIN for civicrm_relation