fix the reg bug