added camera count detection