dictionary javascript
fix bug with duplicate results returned