reg bug fix by cainatomi