added hash map to constructor and now works with two databases