Change waitFor to not require a user defined callback