Implemented the actual thread for reading actions from the server and corrected some bugs