Add error checking.