fix issue with wrong error message