saving login, removed several bugs