fixed closing register/login popup windows properly