changes to DB code