error checking updated