working alerts with error in ejs display