updated visits query