Save Data to file method & bugfixes