disabled gm, fixed a few bugs