error handling for type applications