added scale threshold to merging