BUG: fix declaration-after-statement

closes gh-3930