sanitized write