pub/sub func switch added