replace pointer check with stream