Fix the logic error.