add debug for auto-saving