A couple of issues
addItem in documentation doesn’t exist I presume it’s the method addPassword
The security command line string appends ‘-w' to a field
this is because it adds ‘-w ’ twice and the second the second time doesn’t add a space in front of it..