Fix all issues with adding the url

@runchita20 I discovered several issues regarding adding the url.

I will comment inline the code what and why I have changed things.

If you try this it normally will work! 
You should keep the version in here and in the `version` file the same.
When you change something in `database.xml` you have to increase this number both here and in version