Swap order of cleanup in sharing module