simple error checking.