adding nested promises support