Write into file