use modal instead of alert
fix double count attempts on retry