Fix the scann function.