updated sql queries and removed incrementCounter()