fix bug when raising InvalidMethod exception