fixed a data structure bug