escape table names on sorting

crashed on table named "references"