modified file serialization to avro