Fix condition in stream method