fixes race bug with container metrics h/t peterFritz_