fixed camera detection. some refactoring.
fixed conflict