fixed URL function, added full duplicate testing and warning, modified JS keypress to keydown to allow for modifier keys