add save to file logic