changed extension method error handling