db.close(). added a lot of else"s hoping for more reliability loading from db
more efficient db closing