added serialization to file