add transactions logic