all files could be built. Optimize error check