Fix transaction bug