smart fix ugly bugs