fix create reg file procedure