Adding some try catch blocks