fix a bug in extracting hex mesh