Correct logic error