fixed a few js issues