updated pam check and added fallback