error checking bugfix
error tests