Fix error that was caused by a scoping issue