removed encodeURIComponent() and fixed typo