fixed bug in datapair