bug fix in register