Quantity limiting in JS