$.when with each functions, like doneEach