Fixed error

Now code checks to make sure query logging is enabled