Fredric changed second try to tryCatch