added pm logic