Bug fix in transactions