simplified test for build dir, added error message