fix bug with prefix table name for query