cgiar: fixed boundary check