fixed local variable passing

fixes #418