Use $modx->db->getFullTableName() instead $modx->db->config['table_prefix']