亡羊补牢

亡羊补牢 (wáng yáng bǔ láo)
lit. to mend the pen after sheep are lost (idiom); fig. to act belatedly; better late than never; to lock the stable door after the horse has bolted