fix bug of redundant objects added to dictionary