paste additional checking for stream