Added gm and inv management to mgs