fixed data corruption problem