log out log back in works, needs code tidying