delete redundant scanning code