fix up bounds check and status code