fix updating scans instead of inserting new ones