used wrong value to write file