public Student addStudent() throws ClientException{
        if (logger.isDebugEnabled()){
            logger.debug("Called adding student");
        }
        String groupNumber = null;
        String fak = null;
        for (int i = 0; i < groups.size(); i++) {
            if (elemGr.equals(groups.get(i).getFakulty()) || elemGr.equals(groups.get(i).getNumber())){
                groupNumber = groups.get(i).getNumber();
                fak = groups.get(i).getFakulty();
            }
        }
        try{
            if (client.getShow(fak, groupNumber).size()<tb.getRowCount() || client.getShow(fak, groupNumber).size()==0){
                String fName = tb.getModel().getValueAt(tb.getRowCount()-1, 0).toString();
                String lName = tb.getModel().getValueAt(tb.getRowCount()-1, 1).toString();
                String grnumber = groupNumber;
                String enr = tb.getModel().getValueAt(tb.getRowCount()-1, 2).toString();
                String id = generateID();
        
                try{
                    client.addStudent(grnumber, fName, lName, enr, Integer.valueOf(id));
                }catch(ServerException e){
                    logger.error("Error while adding student",e);
                    throw new ClientException(e);
                }
            }
        }catch(ServerException e){
            logger.error("Error while adding student to database",e);
            throw new ClientException(e);
        }
        
        return student;
    }