Worked around race condition of popupLogin