correcting some bugs in the structure