Fix register key handler