added INVALIDATE_RANGE (not INVALIDATE_BUFFER) to flags