fix g.wait command