Added refresh query / table command before searching if a query / table exists.

Removed refresh before creation of query (exists change should correct this).