introduced 'usedb' variable to prevent making queries on small application that do not use database