Close popup while changing page