BUGFIX: URL.encode
optimized code