fix registration bug