fixed sanitized loop