Corrects id logic error.