Adding working registration code