Add a bounds check