[Added] try catch block