fixed command string builder with gz check