added code to write confessions to db