fixed a wrong error condition