fixed some of the last bugs in remove container function