Add try-catch in the surface view.