Add CheckSamePage function to close Menu