added additional error catching to keep cam from crashing