make the missing error check seperated from invalid error.