fixed js to work