working deiconify, write on file