fix duplicating data bug