private int getInt(String test) {
        int page;
        try {
            page = Integer.parseInt(test);
            if (page < 1) {
                page = 1;
            }
        } catch (NumberFormatException e) {
            page = 1;
        }
        return page;
    }