亡羊补牢

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

亡

wáng

old variant of 亡[wang2]

羊

yáng

sheep; goat

补

bǔ

to repair

牢

láo

firm