Fixed posible closures with promise