fixed issue with random stream causing 'ExecutionEngineException'