fix comments and cnage promise to defered