fix some js issues