fix broken assert logic