added syntax check (uses syntax-error)