fixed endpoint bug