fixing db queries, removing bobbytables