adding PAM to js