fix bug in register