added length check on transaction