changed sanitize data function