added revert function draft