Fixed the lack-of-waiting problem by using Scanner to read the information from the Server