implemented getUserName, added some exception throws