Fixed a bug which caused a bad request URL to be sent