fixed memory leaks with getpass and removed the old commented out implementation