try to use if loop but fail to compile on PC