actually write stuff to the database