fixed bug in transactions