Implemented some thread safety in camera class