revert each function