pretty much finished with database connection