minor typo in error checking