Added pageName into if statement (stop duplicate errors)