Changing is_resource() to $modx->db->is_handle()