fixed a bug assocaited with total_time