Reorder IDE waiting

Sometimes, the command would complete before we started waiting, and we had to rely on the
timeout to wake us up. This should smooth that problem out.