returning a promise from factory.: