updated for urldecoding.