fix bug related to old code