Add login page close detection