sanitize result data to prevent errors