add registration closing functionality