fixed a scope issue, and changed it from exceptions to returning empty map.