fix stream detection