Added better error handling, as well as passwords