Fix issue when sending and receiving file