make write function private