added error handling for when pwdSample fails to provide a suitable set of pairs