fixed bug with background scanning