saves objects to file