fix calling invoke twice or more times if we are using rooms or channels