Added auto-detection of URI