Check for running container before stopping