add sanitize utility function