minor fixes for writting format