fixed error with sql query, labels, logging level and styling