fixed a bug in struct ordering