fixed TryCatch syntax