Fix invalid condition

I suppose this is quite a serious bug, so please consider to approve the change as soon as possible. Thanks in advance!