Catch invalid documents