Fixed potential crash on transation error