added url formatting to perform the right functions