public void bookRoom(MeetingRoom mr, string time) { lock (meetingLocations) { foreach (MeetingLocation ml in meetingLocations) { foreach (MeetingRoom room in ml.GetMeetingRooms()) { if (room.GetName() == mr.GetName()) { if (room.isBooked(time)) { return; } else { room.book(time); } } } } } if (!server.getBackupServer().Equals(server.getURL())) { ServerCli bscli = null; try { bscli = (ServerCli)Activator.GetObject(typeof(ServerCli), server.getBackupServer()[0]); bscli.bookRoom(mr, time); } catch (Exception e) { Task <Message> task = Task <Message> .Factory.StartNew(() => Response("RemoveServerFromView", new List <String>() { bscli.getsURL() })); task.Wait(); } } }