Added try/catch block around get_tempdata()