JS: fixing new visit error