Fixed urlencoding, would like to see if there is better way to do this