add shared helper function to get next url