changes to db handling