write file instead of console.log