fixed logic error in requirement checking