changed file structure, added checks for url