IDIOMS

not a minute too soon

(idiomatic) at the last possible moment; just in time