防微杜漸

Idiom

 * 1) to nip in the bud; to put an end to a bad thing or mistake when it germinates