Added more code and try catch statement.