FIXED VERSION REVERT FUNCTION