Multiple streams logic added