use inline method to change endpoint