Add popup redirect function