slight logic tweak