fixed segfault on string detect