Improve transaction handling, thanks to mick <nik473-forum@yahoo.de>