fix structure bugs