fixed scoping bug that failed some specs