added gcmd function