Change returning promise of When