fix bugs in structure view