add some code for grm