fixed scoping issue in test