updates to DB logic