fixed settlement bug