better ajax url handling