Bug fix

Fixed bug where the saved file was empty