added checkForScanError() to Scanner