fixed some register problem, verify db , other type register and cast