add encodeURIComponent for ajax