catch errors caused by bad declare block. fixes #135