fixing issue of app crashing when no camera is connected