corrected error message on type function