fixed js errors
some fixes