add url encode function for title