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! 
The `[]` syntax for an array is not supported in PHP 5.3.X. You should always use `array()`