fixed bug in pam