write back to file - VM part