Adding Exception handling for KeyNotFoundException