still debugging not writing to db