changed exception to type hinting