cleanup writing of userid in response