Request valid URL from user input instead of current (often empty) URL, and rearrange code a bit, fixes #225