wrote to the wrong file