fixed a few bugs on method complete