fix bug with assert()