Added try catch in strategic places