use sync.RWMutex and format file