JS finished in preference screen

JS should be done in the preference screen.