Added in error checker