added recording of run to main