Ooops was returning the promise and not a function