fixed bug and now clears the table and map for each search