added tryCatch to snipboard writing.