minor scoping bug fix