fixed bug in saveGm function on python side

fixed bug in saveGm function on python side