trying to catch bug with bounds checking