some js fixes