Changed Error messages to JOptionPane