speed up bound check