remove unnecessary pointer check