Fixed scan function