JS: fixing new visit issue