change setTimeout to setInterval to get the webcam to refresh