Wrong logic in embedInStream