writing to db now works too