fixed main for -N option