add register validate to main