fixes an invalid cast exception in Gift Transaction