Set end_time in save function.