Add error testing code