add option for revert or no revert