Fixing error checking on register process