fixed js errors