bug fix for register