fix icpread stopping condition