Fixed error when cancelling the camera.