Incorrect Logic

need change logic