Updated url generation to account for push state conditions