syntax check before function definitions. fixes #6