check for out of range reads and writes