fixed command generation bug