fix filename & logic in "build" shell