fixes js errors