fix KeyError inside validate_body function