Finally it is fixed. Don't use argv[0] to check if the arguments are valid.