Could you look into the observation Ned made about `_MODULESTORES` being a local variable?  It seems like we might need to use the `global` keyword here (or leave out the `_MODULESTORES` line entirely)