public void send(Command cmd) {
        try {
            //System.out.println("Sending Command -> " + cmd);
            if (!cmd.equals(prev)) {
                this.oos.writeObject(cmd);
            }

            if ((reply = this.reader.readLine()) != null) {
                System.out.println(reply);
                if (reply.equals("-1")) {
                    closeConnection();
                }
            }
        } catch (SocketException e) {
            System.err.println("SocketException with message: " + e.getMessage());
            System.exit(-1);
        } catch (IOException e) {
            System.err.println("IOExcpetion with message: " + e.getMessage());
            System.exit(-1);
        } catch (Exception e) {
            System.err.println("Unknown Excpetion with message: " + e.getMessage());
            System.exit(-1);
        }
    }