Modify relation of Class and add try catch.