js errors fixed