change to check for transaction rather than type