buggy receiving file from client