Refined the allert box JS code.