changed url encode method