Changed the way of checking the build flag in WG

If you find another way to do it, you're welcome to try, but I think this is a good way to check the build ability :)