added modal and fixed alert problem