reset keys before init, refresh after init