updated $.pledge to include .wait()