Exception: Call to a member function addCml() on null