add logout, fix init