fix alert window to not show too early