change logic to unless instead of if, to ensure readability, and consistency