fixed checking/unchecking in js