fix stream check