Fixed bug where qty was passed as data not a parameter