fixed bug in structure.js