Adds exception KeyError block