Problem wtih UBAQ - PODetail unit cost

I have a UBAQ that updates the unit cost field in PODetail. It seems to work fine with a po containing only one detail line. When more than one line exists, the unit cost is updated correctly, but the 'qty' of the last detail line is overwritten with the 'qty' of the line I changed. Any idea what causes this. (Epicor 9.05.701)