Implement jquery promise while adding pool.