p.onSecurityChange is not a function