added Try Catch and Finally