making the publish cast to dynamic