fix error checking for argv