fixed table name logical flaw