add additional check to make sure it is a stream instance