add timeout and output csv