modify the gdm.R