fixed bug in code for exchanging items