change scan logic