fix the setting points function