Attempt to correct the logic error