fixed problem with client and server becoming out of sync, file still comes out wrong though