also check for undefined on destroy of stream