adding transaction and debug