edited register to display errors better