added debug logging to PAM