fixing stream method