add db_transaction for making writes to database