implemented refresh sql statement