fix after code review.
Merge pull request #5819 from Wikia/DAT-2350_fix_wrong_logic

fix wrong logic issue