Fixed issue with transaction handling