add safety guard for ill defined user types
move error handling code out of fast path