added error checking for update tr