error checking.