fixing thenResolve bug