Solved bug when command execute return a promise. The onResult handler was executed with the promise instead of the promise resolution value