Add error text in transformTree method