updated conditionals, added careful db_push