writeVisibility template fixed