use 2 seprate variable for autoclosing windows to avoid to quick closing when sharing, the popup can be close before the link is save