better implementation

fix bug about visits