In Scanner, call callback outside the try-catch, so errors are not ignored.