bag cleanup, suggested by PtrMan