fix bug in getting mac addr