change the methods to use try