Reverted some changes to fix a bug leading to a tx deadlock