file structure check and fix attempt