fix test crash in debugmode.