public void register() {
        if(userBean.getPassword().equals(userBean.getConfirmedPassword())) {
            if (AccessDB.getInstance().isValidCode(userBean.getAccessCode())){
                if(Register.register(userBean)) {
                    userBean.setLoggedIn(true);
                    
                    FacesContext context = FacesContext.getCurrentInstance();
                    ExternalContext externalContext = context.getExternalContext();

                    if(userBean.getOriginalURL() != null) {
                        try {
                            externalContext.redirect(userBean.getOriginalURL());
                        }
                        catch(IOException ex) {
                            ex.printStackTrace();
                        }
                    }
                }
                else {
                    response = "Username is already taken.";
                }
                
            }
            else{
                response = "Invalid Access Code.";
                //response = ""+AccessDB.getInstance().isValidCode(userBean.getAccessCode());

            }
            
        }
        else {
            response = "Passwords do not match!";
        }
        
    }