Fix bug where transactions would execute twice