improve rescan
fix a bit