Fix double scanning

Fix the crash caused by double scanning