fix bugs and add new fields into registration