go back to scoped references, i'm getting a nasty bad memory accessed error