added method to get a db instance