fix the bug with transaction