added unit test for limited hash map
added error handling