Fix bug #2590

replaced wrong check to correct check
Merge pull request #780 from sivapvarma:2.4