some js improvement