writing to DB now works