fixed validate_attachement