few errors on js edited