changed __sanitize() function to only sanitize strings