Attempting to fix writing failure