fix bug in writing xls file