fix clean_structure bug