change min_quantity and max_quantity function