Revised alert callback handler; added loading state to time-consuming actions to prevent repeated requests