updated build command logic