Corrected condition

Fixes #1037 - thank you @fi5er