correctly scoped local var