working distributed version with rm monitoring