settlement js promise fixed