logging to db works