fixed bug of not sending the whole file and sending it with the wrong first part