catching TypeError for issue #17