Fixed the saving function, the new global database system should work now.