fixed a check which was broken by commit 9f02ad43aa9415429d3b95b9b4f3762be946b915