CID-1256277 logic error fixed