Fixed encodeURI bug in location URL