throwing exception if no key is found