debug the lost of context when returning a promise