wrong error checking