update mode in js