fix bug with assert