move keys.init to the top