fixed log line and added url encoding to token string