add save to file functionality