modified version for url handling