added some checks to the popcorn-build script