adjusted exception type and checked for unused parameter