error checking, wip