Fix bug with creating transaction