#register and test for errors