updated transaction functions with error checking