Replaced alerts with modals, got things working.