public void saveGame(JFrame frame) {
        JFileChooser fileChooser = new JFileChooser(".");
        int result = fileChooser.showSaveDialog(frame);
        if (result == JFileChooser.APPROVE_OPTION) {
            File file = fileChooser.getSelectedFile();
            if (file.exists()
                    && JOptionPane.showConfirmDialog(frame,
                            "File \"" + file.getName() + "\" already exists.\n"
                                    + "Would you like to replace it?", "Save",
                            JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {
                return;
            }
            try {
                FileOutputStream fos = new FileOutputStream(file);
                ObjectOutputStream outStream = new ObjectOutputStream(fos);
                outStream.writeObject(grid.vaulesToString());
                outStream.flush();
                outStream.close();

            } catch (IOException e) {
            	createErrorMessage(e, frame);
            }
        }
    }