added multiple tries and option to delete previous

also some refactoring and use of set_user