fixed add/edit js error