added Try catch