saving before multithreading