Fixed botched sanitization function