fix wasted if