change non-interactive code to return passwd