fixed file save method to actually save the contents of the file