Add check for closed stream