Fix some bugs in file transfer

now it need protocol impovment