update js error handling