change getopt return from char to int