added check for directory existance in build script