Adding try catch block for the camera setup.