Fixed scanning bug