Make sure to cast quantity to an integer