update validation of register, register function