not tested, added logic for input url