Fixed potential crash on rescan