made function publish dynamic for classes and attributes