fix logout where data wasn't written to db