fix bugs on saving cache model
fix bugs when updating agents; use a new thread to broadcast new agent