Added some debug alert in JS code