Use instanceof rather than === to check record type.