key register called at the right moment