in read_sex() fix return from 1 to 0