improve getWebcam method.