didnt seem to like json.dumps after logout, moved it up