refine wait_for_compile.sh