fixed alert api for the new alert values and made it better for any changes later