亡羊补牢[wáng yáng bǔ láo]
mend the fold after the sheep have been stolen; lock the stable door after the horse has been stolen; mend the fold after a sheep is lost; shut the stable door after the steed has been stolen; The sheep has gone astray and its pen must be mended.