Added in error testing