SERVER-10086 fix improper removing from a container

also may fix SERVER 10496