fixed bad scan bug