Error checking for register