fixed bug in data transfer