it logs to the db