create error messages and improve build script