throw error on read out of bounds