VID-2127 Fix small logic error