There are several major issues with this plugin. The first is that you aren't looking at the data in the vault at all. You get it from the vault but you don't actually do anything with it. Though I'm confident you're not setting and getting the data to and from the vault properly. You're also wrongly using both of your global variables. In fact, neither of those global variables should exist in this plugin.
It would probably be easier to help you with this if you can explain what you are actually trying to do.