fixed segfault in syntax function