fix issue: wrong variable name and opposite logic