fixed logic for tests