implement checkBeforeBuild and checkAfterBuild