finish load and save function