Implemented cms detection.