fix fast path check to reduce allocations