fixing some js issues