modify keys M to Keys(M)