error checking finished