Added substream listener using recursion