Added pointer check