Changed quantity to thresold