admin main_js refactored using jquery on()