fixed logic error caused by wrong variable name