fixed the js code for checkbox check/uncheck