fix url generation and tests