fix xml-getid bugs
check the return ID if None or not in main file