added a while in camerahandler