BAZYNGO-1409: fixed logic error