added scale min and max