fixed scoping inconsistency