Add some logic of writing track data