add limit to write switch output.