fixing errors with revert