test added for the exceptional handling in invert